package com.itlong.cloud.operate.resource;


import com.itlong.cloud.POJO.DTO.operate.OperateDeviceWhiteListAuthFileConsumeRecordsDTO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceWhiteListAuthFileConsumeRecordsVO;
import com.itlong.cloud.equip.operate.IOperateDeviceWhiteListAuthFileConsumeRecordsServiceClient;
import com.itlong.cloud.operate.service.IOperateDeviceWhiteListAuthFileConsumeRecordsService;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <desc>
 * 运营-设备白名单授权文件消费信息记录管理接口暴露实现类
 * </desc>
 * 
 * @author: chengshican
 *  @Date: 2020-08-11 15:18
 *  
 */


@RestController
public class OperateDeviceWhiteListAuthFileConsumeRecordsServiceResource implements IOperateDeviceWhiteListAuthFileConsumeRecordsServiceClient {

    @Autowired
    private IOperateDeviceWhiteListAuthFileConsumeRecordsService authFileConsumeRecordsService;

      
      /**
      *<desc>
      * 分页获取设备白名单消费授权文件消费记录信息
      *</desc>
      *
      * @Author  chengshican
      * @Date   2020-08-11 15:38
      * @Param  recordsDTO 查询参数DTO
      * @Return      
      * @Exception   
      * 
      */
     @Override
     @RequestMapping(path = "/operate/device/whiteList/authFileConsumeRecords/getAuthFileConsumeRecordsByPage",method = RequestMethod.POST)
     public Page<OperateDeviceWhiteListAuthFileConsumeRecordsVO> getWhiteListAuthFileConsumeRecordsByPage(@RequestBody OperateDeviceWhiteListAuthFileConsumeRecordsDTO recordsDTO) throws Exception  {
          Page<OperateDeviceWhiteListAuthFileConsumeRecordsVO> authFileConsumeRecordsByPage = authFileConsumeRecordsService.getWhiteListAuthFileConsumeRecordsByPage(recordsDTO);
          return authFileConsumeRecordsByPage;
      }

     /**
     *<desc>
     * 保存授权文件消费信记录信息
     *</desc>
     *
     * @Author  chengshican
     * @Date   2020-08-11 15:46
     * @Param  recordsDTO 保存参数DTO
     * @Return      保存结果
     * @Exception   
     * 
     */
     @Override
     @RequestMapping(value = "/operate/device/whiteList/authFileConsumeRecords/save",method = RequestMethod.POST)
    public Integer save(@RequestBody OperateDeviceWhiteListAuthFileConsumeRecordsDTO recordsDTO) throws Exception {
         return authFileConsumeRecordsService.save(recordsDTO);
      }

      
     
     /**
     *<desc>
     * 根据授权规则id  ruleId查询授权文件消费信息
     *</desc>
     *
     * @Author  chengshican
     * @Date   2020-08-11 15:52
     * @Param  ruleId 规则id
     * @Return   授权文件消费信息
     * @Exception   
     * 
     */ 
    @Override
    @RequestMapping(value = "/operate/device/whiteList/authFileConsumeRecords/getAuthFileConsumeRecordsByRuleId",method = RequestMethod.POST)
    public OperateDeviceWhiteListAuthFileConsumeRecordsVO getWhiteListAuthFileConsumeRecordsByRuleId(@RequestParam("ruleId") String ruleId) {
        return authFileConsumeRecordsService.getWhiteListAuthFileConsumeRecordsByRuleId(ruleId);
    }


}
